package com.caifu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.caifu.pojo.SysUserRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 用户角色表 Mapper 接口
 * </p>
 *
 * @author tww
 * @since 2021-03-01
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {


    /**
     * 功能描述: 获取角色授权用户数
     * @Author: szt
     * @Date:   2020/11/9
     */
    @Select("select count(*) from sys_user_role r left join sys_user u on u.user_no=r.user_id where u.user_no is not null and r.role_id=#{roleId}")
    int getUserRoleCount(@Param("roleId")int roleId);
}
